build: Disable Android debug variants outside the sample app - #5824
Closed
runningcode wants to merge 1 commit into
Closed
build: Disable Android debug variants outside the sample app#5824runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
Unit tests already target the release variant (testBuildType = release) and CI disabled the debug variant. Disable the debug variant locally too so local builds match CI and skip building the unused variant. The sample app keeps both variants for manual runs and profiling. Update the contributor docs and test skill to reference testReleaseUnitTest instead of testDebugUnitTest. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
runningcode
marked this pull request as ready for review
July 23, 2026 08:23
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
July 23, 2026 08:23
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 50cdc0a. Configure here.
| // variant, so building the debug variant would only add overhead. | ||
| fun shouldSkipDebugVariant(name: String?): Boolean { | ||
| return System.getenv("CI")?.toBoolean() ?: false && name == "debug" | ||
| return name == "debug" |
There was a problem hiding this comment.
Sample debug variant resolution broken
High Severity
shouldSkipDebugVariant now always disables library debug variants, while sentry-samples-android still builds debug and depends on those projects (including via debugImplementation). The sample debug build type has no matchingFallbacks to release, so installDebug/assembleDebug can fail variant-aware dependency resolution.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 50cdc0a. Configure here.
runningcode
marked this pull request as draft
July 23, 2026 08:47
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 22f4345 | 325.23 ms | 454.66 ms | 129.43 ms |
| 22f4345 | 312.78 ms | 347.40 ms | 34.62 ms |
| 8558cac | 306.16 ms | 355.24 ms | 49.09 ms |
| bb0ff41 | 317.76 ms | 384.66 ms | 66.90 ms |
| 7c1a728 | 289.46 ms | 368.15 ms | 78.69 ms |
| d501a7e | 314.55 ms | 343.34 ms | 28.79 ms |
| 4fc476b | 280.63 ms | 363.04 ms | 82.42 ms |
| 6727e14 | 337.22 ms | 373.94 ms | 36.71 ms |
| ae7fed0 | 293.84 ms | 380.22 ms | 86.38 ms |
| ee747ae | 400.46 ms | 423.61 ms | 23.15 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 22f4345 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| 22f4345 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| 8558cac | 0 B | 0 B | 0 B |
| bb0ff41 | 0 B | 0 B | 0 B |
| 7c1a728 | 0 B | 0 B | 0 B |
| d501a7e | 0 B | 0 B | 0 B |
| 4fc476b | 0 B | 0 B | 0 B |
| 6727e14 | 1.58 MiB | 2.28 MiB | 718.64 KiB |
| ae7fed0 | 1.58 MiB | 2.12 MiB | 551.77 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


📜 Description
Unit tests already run against the
releasevariant (testBuildType = "release"), and CI already disabled the Androiddebugvariant. This makes the same thing happen locally:Config.Android.shouldSkipDebugVariantnow skips thedebugvariant everywhere (not just in CI), so local builds of the libraries and integration-test apps match CI and no longer configure/build the unuseddebugvariant.sentry-samples-android) keeps bothdebugandreleasevariants locally and in CI, so manual runs and btrace profiling (installDebug) still work.AGENTS.md,.cursor/rules/coding.mdc) and thetestskill to referencetestReleaseUnitTestinstead oftestDebugUnitTest.sentry-android-coreto the release task.💡 Motivation and Context
All unit tests use the release variant, so the debug variant only added build/configuration overhead locally, and the docs pointed contributors (and agents) at a
testDebugUnitTesttask that no longer runs.💚 How did you test it?
./gradlew :sentry-android-core:tasks --all— onlytestReleaseUnitTestis present; noassembleDebug/testDebugUnitTest../gradlew :sentry-samples:sentry-samples-android:tasks --all— bothinstallDebug/assembleDebugand their release counterparts remain../gradlew spotlessApply apiDump— passes with no API changes.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog